<?php echo $form->renderFormTag('#', array('id' => 'form', 'method' => "post", "class" => "form")) ?>
<?= $form->renderHiddenFields() ?>
<fieldset>
    <div class="widget">
        <div class="title"> <?= image_tag('icons/color/plus.png', array("class" => "titleIcon")); ?><h6>New Customer</h6></div>
        <div class="fluid">

            <div class="formRow">
                <label>Customer:</label>
                <div class="formRight">
                    <span class="span2"><span class="formNote">Title</span><?php echo $form['title_id']->render(array('data-placeholder' => " - - Select - - ", 'style' => "width:100%;", 'class' => "chzn-select")); ?> </span>
                    <span class="span6"><span class="formNote">Name</span><?php echo $form['customer_name']->render(array()); ?> </span>
                </div>
                <div class="formRight">
                    <span class="span3"><label for="title_id" generated="true" class="error"><?= $form['title_id']->renderError(); ?></label></span>
                    <span class="span6"><label for="customer_name" generated="true" class="error"><?= $form['customer_name']->renderError(); ?></label></span>
                </div>
            </div>

            <div class="formRow">
                <label>Activity: <br><div class="addItem" id="addActivity">Add Activity</div></label>
                <?php for ($i = 0; $i < $count['activity']; $i++): ?>
                    <div class="parentShowDelete">
                        <div class="formRight " style="position: relative;">
                            <span class="span3"><span class="formNote">Type</span><?php echo $form['activity_id_' . $i]->render(array('data-placeholder' => " - - Select - - ", 'style' => "width:100%;", 'class' => "chzn-select")); ?> </span>
                            <span class="span3"><span class="formNote">Size</span><?php echo $form['activity_size_' . $i]->render(); ?> </span>
                            <?php if ($i > 0): ?><div class="showDeleteIcon delModifyLess" onClick="deletePhone(this)"></div> <?php endif; ?>
                        </div>
                        <div class="formRight ">
                            <span class="span3"><label for="activity_id" generated="true" class="error"><?= $form['activity_id_' . $i]->renderError(); ?></label></span>
                            <span class="span3"><label for="activity_size" generated="true" class="error"><?= $form['activity_size_' . $i]->renderError(); ?></label></span>
                        </div>
                    </div>
                <?php endfor; ?>
            </div>

            <div class="formRow">
                <label>Shipping Address:</label>
                <div class="formRight">
                    <span class="span6"><?php echo $form['shipping_address']->render(array()); ?> </span>
                    <span class="span6"><label for="address" generated="true" class="error"><?= $form['shipping_address']->renderError(); ?></label></span>
                </div>
            </div>

            <div class="formRow">
                <label>Billing Address:</label>
                <div class="formRight">
                    <span class="span6"><?php echo $form['billing_address']->render(array()); ?> </span>
                    <span class="span6"><label for="address" generated="true" class="error"><?= $form['billing_address']->renderError(); ?></label></span>
                </div>
            </div>

            <div class="formRow">
                <label>E-Mail:</label>
                <div class="formRight">
                    <span class="span6"><?php echo $form['email']->render(array()); ?> </span>
                    <span class="span6"><label for="email" generated="true" class="error"><?= $form['email']->renderError(); ?></label></span>
                </div>
            </div>

            <div class="formRow">
                <label>Owner Info:</label>
                <div class="formRight">
                    <span class="span2"><span class="formNote">Title</span><?php echo $form['title_id_owner']->render(array('data-placeholder' => " - - Select - - ", 'style' => "width:100%;", 'class' => "chzn-select")); ?> </span>
                    <span class="span6"><span class="formNote">Name</span><?php echo $form['name_owner']->render(array()); ?> </span>
                </div>
                <div class="formRight">
                    <span class="span3"><label for="title_id" generated="true" class="error"><?= $form['title_id_owner']->renderError(); ?></label></span>
                    <span class="span6"><label for="owner_name" generated="true" class="error"><?= $form['name_owner']->renderError(); ?></label></span>
                </div>
                <div class="formRight">
                    <span class="span6"><span class="formNote">E-Mail</span><?php echo $form['email_owner']->render(array()); ?> </span>
                </div>
                <div class="formRight">
                    <span class="span6"><label for="name" generated="true" class="error"><?= $form['email_owner']->renderError(); ?></label></span>
                </div>
                <?php for ($i = 0; $i < $count['owner']; $i++): ?>
                    <div class="parentShowDelete">
                        <div class="formRight " style="position: relative;">
                            <span class="span6"><span class="formNote">Phone / mobile</span><?php echo $form['phone_owner_' . $i]->render(); ?> </span>
                            <div class="showAddIcon addModify" onClick="addPhone(this)"></div> <?php if ($i > 0): ?> <div class="showDeleteIcon delModify" onClick="deletePhone(this)"></div> <?php endif; ?>
                        </div>
                        <div class="formRight ">
                            <span class="span6"><label for="activity_size" generated="true" class="error"><?= $form['phone_owner_' . $i]->renderError(); ?></label></span>
                        </div>
                    </div>
                <?php endfor; ?>
            </div>

            <div class="formRow">
                <label>Consultant Info:</label>
                <div class="formRight">
                    <span class="span2"><span class="formNote">Title</span><?php echo $form['title_id_consultant']->render(array('data-placeholder' => " - - Select - - ", 'style' => "width:100%;", 'class' => "chzn-select")); ?> </span>
                    <span class="span6"><span class="formNote">Name</span><?php echo $form['name_consultant']->render(array()); ?> </span>
                </div>
                <div class="formRight">
                    <span class="span3"><label for="title_id" generated="true" class="error"><?= $form['title_id_consultant']->renderError(); ?></label></span>
                    <span class="span6"><label for="consultant_name" generated="true" class="error"><?= $form['name_consultant']->renderError(); ?></label></span>
                </div>
                <div class="formRight">
                    <span class="span6"><span class="formNote">E-Mail</span><?php echo $form['email_consultant']->render(array()); ?> </span>
                </div>
                <div class="formRight">
                    <span class="span6"><label for="name" generated="true" class="error"><?= $form['email_consultant']->renderError(); ?></label></span>
                </div>
                <?php for ($i = 0; $i < $count['consultant']; $i++): ?>
                    <div class="parentShowDelete">
                        <div class="formRight " style="position: relative;">
                            <span class="span6"><span class="formNote">Phone / mobile</span><?php echo $form['phone_consultant_' . $i]->render(); ?> </span>
                            <div class="showAddIcon addModify" onClick="addPhone(this)"></div><?php if ($i > 0): ?><div class="showDeleteIcon delModify" onClick="deletePhone(this)"></div> <?php endif; ?>
                        </div>
                        <div class="formRight ">
                            <span class="span6"><label for="activity_size" generated="true" class="error"><?= $form['phone_consultant_' . $i]->renderError(); ?></label></span>
                        </div>
                    </div>
                <?php endfor; ?>
            </div>

            <div class="formRow">
                <label>Key Person Info:</label>
                <div class="formRight">
                    <span class="span2"><span class="formNote">Title</span><?php echo $form['title_id_key_person']->render(array('data-placeholder' => " - - Select - - ", 'style' => "width:100%;", 'class' => "chzn-select")); ?> </span>
                    <span class="span6"><span class="formNote">Name</span><?php echo $form['name_key_person']->render(array()); ?> </span>
                </div>
                <div class="formRight">
                    <span class="span3"><label for="title_id" generated="true" class="error"><?= $form['title_id_key_person']->renderError(); ?></label></span>
                    <span class="span6"><label for="key_person_name" generated="true" class="error"><?= $form['name_key_person']->renderError(); ?></label></span>
                </div>
                <div class="formRight">
                    <span class="span6"><span class="formNote">E-Mail</span><?php echo $form['email_key_person']->render(array()); ?> </span>
                </div>
                <div class="formRight">
                    <span class="span6"><label for="name" generated="true" class="error"><?= $form['email_key_person']->renderError(); ?></label></span>
                </div>
                <?php for ($i = 0; $i < $count['key_person']; $i++): ?>
                    <div class="parentShowDelete">
                        <div class="formRight " style="position: relative;">
                            <span class="span6"><span class="formNote">Phone / mobile</span><?php echo $form['phone_key_person_' . $i]->render(); ?> </span>
                            <div class="showAddIcon addModify" onClick="addPhone(this)"></div><?php if ($i > 0): ?><div class="showDeleteIcon delModify" onClick="deletePhone(this)"></div> <?php endif; ?>
                        </div>
                        <div class="formRight ">
                            <span class="span6"><label for="activity_size" generated="true" class="error"><?= $form['phone_key_person_' . $i]->renderError(); ?></label></span>
                        </div>
                    </div>
                <?php endfor; ?>
            </div>

            <div class="formRow">
                <label>Contacts Info:  <br><div class="addItem" id="addContact">Add Contact</div></label>
                <?php for ($i = 0; $i < (count($count) - 4); $i++): ?>
                    <div class="formRight Contacts" style="position: relative;"><div class="showDelete4Contact" onClick="deleteContact(this)"></div>
                        <div class="formRight contact">Contact <?= $i + 1 ?></div>
                        <div class="formRight">
                            <span class="span2"><span class="formNote">Title</span><?php echo $form['title_id_contact_' . $i]->render(array('data-placeholder' => " - - Select - - ", 'style' => "width:100%;", 'class' => "chzn-select")); ?> </span>
                            <span class="span6"><span class="formNote">Name</span><?php echo $form['name_contact_' . $i]->render(array()); ?> </span>
                        </div>
                        <div class="formRight">
                            <span class="span3"><label for="title_id" generated="true" class="error"><?= $form['title_id_contact_' . $i]->renderError(); ?></label></span>
                            <span class="span6"><label for="name" generated="true" class="error"><?= $form['name_contact_' . $i]->renderError(); ?></label></span>
                        </div>
                        <div class="formRight">
                            <span class="span6"><span class="formNote">Position</span><?php echo $form['position_contact_' . $i]->render(array()); ?> </span>
                        </div>
                        <div class="formRight">
                            <span class="span6"><label for="name" generated="true" class="error"><?= $form['position_contact_' . $i]->renderError(); ?></label></span>
                        </div>
                        <div class="formRight">
                            <span class="span6"><span class="formNote">E-Mail</span><?php echo $form['email_contact_' . $i]->render(array()); ?> </span>
                        </div>
                        <div class="formRight">
                            <span class="span6"><label for="name" generated="true" class="error"><?= $form['email_contact_' . $i]->renderError(); ?></label></span>
                        </div>
                        <?php for ($j = 0; $j < $count[$i]; $j++): ?>
                            <div class="parentShowDelete">
                                <div class="formRight " style="position: relative;">
                                    <span class="span6"><span class="formNote">Phone / mobile</span><?php echo $form['phone_contact_' . $i . '_' . $j]->render(); ?> </span>
                                    <div class="showAddIcon addModify" onClick="addPhone(this)"></div><?php if ($j > 0): ?><div class="showDeleteIcon delModify" onClick="deletePhone(this)"></div> <?php endif; ?>
                                </div>
                                <div class="formRight ">
                                    <span class="span6"><label for="activity_size" generated="true" class="error"><?= $form['phone_contact_' . $i . '_' . $j]->renderError(); ?></label></span>
                                </div>
                            </div>
                        <?php endfor; ?>
                    </div>
                <?php endfor; ?>
            </div>

            <div class="formRow">
                <label>Payment Method:</label>
                <div class="formRight"><?php $x = $form['payment_method']->getValue(); ?>
                    <span class="span3"><input type="radio" <?= ($x == 'cheque') ? 'checked' : ''; ?> id="customer_payment_method_cheque" value="cheque" name="customer[payment_method]"> Cheque </span>
                    <span class="span3"><input type="radio" <?= ($x == 'cash') ? 'checked' : ''; ?> id="customer_payment_method_cash" value="cash" name="customer[payment_method]"> Cash </span>
                    <span class="span3"><input type="radio" <?= ($x == 'open account') ? 'checked' : ''; ?> id="customer_payment_method_open_account" value="open account" name="customer[payment_method]"> Open Account </span>
                    <span class="span6"><label for="payment_method" generated="true" class="error"><?= $form['payment_method']->renderError(); ?></label></span>
                </div>
            </div>

            <div class="formRow">
                <label>Payment History:</label>
                <div class="formRight"><?php $x = $form['payment_history']->getValue(); ?>
                    <span class="span3"><input type="radio" <?= ($x == 'poor') ? 'checked' : ''; ?> id="customer_payment_history_poor" value="poor" name="customer[payment_history]"> Poor </span>
                    <span class="span3"><input type="radio" <?= ($x == 'good') ? 'checked' : ''; ?> id="customer_payment_history_good" value="good" name="customer[payment_history]"> Good </span>
                    <span class="span3"><input type="radio" <?= ($x == 'excellent') ? 'checked' : ''; ?> id="customer_payment_history_excellrnt" value="excellent" name="customer[payment_history]"> Excellent </span>
                    <span class="span6"><label for="payment_history" generated="true" class="error"><?= $form['payment_history']->renderError(); ?></label></span>
                </div>
            </div>


            <div class="formRow">
                <label>Notes:</label>
                <div class="formRight">
                    <span class="span8"><?php echo $form['notes']->render(array()); ?> </span>
                    <span class="span6"><label for="notes" generated="true" class="error"><?= $form['notes']->renderError(); ?></label></span>
                </div>
            </div>


            <div class="wizButtons"> 
                <span class="wNavButtons">
                    <a class="wButton greenwB ml15 m10" title="" onClick="addCustomer(true)" href="javascript:void(0);"><span> S u b m i t </span></a>
                </span>
            </div>
        </div>


    </div>
</fieldset>
</form>

<div class="hiddenItems" style="display: none;">
</div>
